package com.yunchao.bank.business.domain.repository

import com.yunchao.bank.business.domain.model.BusinessInfoModel
import com.yunchao.bank.business.domain.model.BusinessPackModel
import kotlinx.coroutines.flow.Flow

internal interface BusinessRepository {


    suspend fun getBusinessInfo(taskId: Int): Result<BusinessInfoModel?>

    suspend fun setupPower(isLoop: Boolean): Result<Boolean>


    suspend fun inventoryOnce(
        businessInfoModel: BusinessInfoModel,
        packInfoMap: Map<String, BusinessPackModel>
    ): Result<BusinessPackModel>

    suspend fun inventoryLoop(
        businessInfoModel: BusinessInfoModel,
        packInfoMap: Map<String, BusinessPackModel>
    ): Flow<List<BusinessPackModel>>


    suspend fun inventoryStop(
        businessInfoModel: BusinessInfoModel,
        payloads: List<BusinessPackModel>,
        isLoop: Boolean
    )


    suspend fun closeLockWriteLogistics(
        businessInfoModel: BusinessInfoModel,
        packInfo: BusinessPackModel,
        busiInfo: BusinessPackModel,
        pageNumber: Int
    ): Result<BusinessPackModel>

    suspend fun openLockWriteLogistics(
        packInfoMap: Map<String, BusinessPackModel>,
        taskInfo: BusinessInfoModel
    ): Result<BusinessPackModel>


    suspend fun submitBusiness(
        businessInfoModel: BusinessInfoModel,
        items: List<BusinessPackModel>
    ): Result<String>
}